d-sparc64-fix-fnctls
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Mon, 28 Jan 2019 06:02:48 +0000 (06:02 +0000)
committerXimin Luo <infinity0@debian.org>
Mon, 28 Jan 2019 06:02:48 +0000 (06:02 +0000)
Gbp-Pq: Name d-sparc64-fix-fnctls.patch

src/librustc_data_structures/flock.rs

index 86e48e21626abd39b4a9546c237de189595464f9..d48814055f20664f3089dbe392af96ab9bfd799c 100644 (file)
@@ -42,11 +42,21 @@ cfg_if! {
                 pub l_sysid: libc::c_int,
             }
 
-            pub const F_RDLCK: libc::c_short = 0;
-            pub const F_WRLCK: libc::c_short = 1;
-            pub const F_UNLCK: libc::c_short = 2;
-            pub const F_SETLK: libc::c_int = 6;
-            pub const F_SETLKW: libc::c_int = 7;
+            cfg_if! {
+                if #[cfg(target_arch = "sparc64")] {
+                   pub const F_RDLCK: libc::c_short = 1;
+                   pub const F_WRLCK: libc::c_short = 2;
+                   pub const F_UNLCK: libc::c_short = 3;
+                   pub const F_SETLK: libc::c_int = 8;
+                   pub const F_SETLKW: libc::c_int = 9;
+                } else {
+                   pub const F_RDLCK: libc::c_short = 0;
+                   pub const F_WRLCK: libc::c_short = 1;
+                   pub const F_UNLCK: libc::c_short = 2;
+                   pub const F_SETLK: libc::c_int = 6;
+                   pub const F_SETLKW: libc::c_int = 7;
+                }
+            }
         }
 
         #[cfg(target_os = "freebsd")]